from datetime import datetime
import threading
import time


def printChinesePoliteness():
    start_time = datetime.now()  # 记录开始时间
    while True:
        current_time = datetime.now()
        elapsed_time = (current_time - start_time).total_seconds()  # 计算已过去的时间
        if elapsed_time >= 15:  # 如果已过去的时间超过15秒
            print("时间到")
            break
        print(current_time)
        time.sleep(1)


thread1 = threading.Thread(target=printChinesePoliteness,
                           name='process_load')

thread1.start()

# 等待第一个线程完成
thread1.join()
